Skip to content

Convert libnvme to 'struct nvmf_context' as function argument#3203

Open
hreinecke wants to merge 10 commits intolinux-nvme:masterfrom
hreinecke:fctx
Open

Convert libnvme to 'struct nvmf_context' as function argument#3203
hreinecke wants to merge 10 commits intolinux-nvme:masterfrom
hreinecke:fctx

Conversation

@hreinecke
Copy link
Collaborator

Convert all callers using separate fabrics arguments like 'transport', 'traddr' etc to use 'struct nvmf_context' instead.

To simplify the interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
To simplify the interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
To simplify the interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Separate out _nvme_create_ctrl() as a simpler interface to
nvme_create_ctrl() which accepts a 'struct nvmf_context' as
argument.

Signed-off-by: Hannes Reinecke <hare@suse.de>
…ntry()

To simplify the interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
To simplify the interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Replace with nvme_ctrl_find() and make it static to avoid
function name clashes.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Re-implement __nvme_lookup_ctrl() as equivalent to nvme_lookup_ctrl()
but taking 'struct nvmf_context' as argument. Care needs to be taken
to handle the 'subsysnqn' entry in 'struct nvmf_context';
__nvme_ctrl_find() needs to be called with a 'NULL' subsysnqn as the
controller might be on any subsystem, and we need to set 'subsysnqn'
to the NQN of the subsystem the controller should be created in rather
than the subsysnqn from 'struct nvmf_context' (which might be empty).

Signed-off-by: Hannes Reinecke <hare@suse.de>
Use 'struct nvmf_context' throughout the file to test the new
interface.

Signed-off-by: Hannes Reinecke <hare@suse.de>
All functions have been converted to the new interface, so rename
__nvme_lookup_ctrl() to nvme_lookup_ctrl() and drop the wrapper.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant